<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="middle padtop10 myclear">
	<div class="page-content">
		
		<!-- bread crumb -->
		<p id="bread-crumb">
			<a href="<?php echo base_url();?>"><?php echo $lang['home']?></a>
			<a href="<?php echo site_url('user/listzone');?>"><?php echo $lang['zone']?></a>
			<?php echo $zone->name;?>
		</p><!-- end bread crumb -->
		
		<h3>
			<?php echo $lang['zone']?>
		</h3>
		<br style="clear:both;" />
		
		<table cellpadding="0" cellspacing="0" width="100%" border="1" class="martop10 tbl-list">
			<tr>
				<td><b><?php echo $lang['INVOCATION_CODE']?></b><br />
				<textarea readonly="true" style="width: 99.4%; height: 50px;"><?php echo str_replace('%s', $zone_id, $script_zone_format)?></textarea>
				</td>
			</tr>
		</table>
		
		<p style="font-size:18px;margin:30px 0 0"><?php echo $lang['item_list']?></p>
		<table cellpadding="0" cellspacing="0" width="100%" border="1" class="martop10 tbl-list">
			<tr>
				<td class="td-label"><strong>#</strong></td>
				<td class="td-label"><strong><?php echo $lang['anh']?></strong></td>
				<td class="td-label"><strong><?php echo $lang['title']?></strong></td>
				<td class="td-label"><strong><?php echo $lang['status']?></strong></td>
				<td class="td-label"><strong><?php echo $lang['start']?></strong></td>
				<td class="td-label"><strong><?php echo $lang['end']?></strong></td>
				<td class="td-label"><strong><?php echo $lang['creator']?></strong></td>
			</tr>
			<?php $i = 1; foreach ($items as $item){?>
			<tr>
				<td><?php echo $i?></td>
				<td><img src="<?php echo $item['filename']?>" border="0" /></td>
				<td><?php echo $item['bannername']?></td>
				<td><?php echo $lang['arr_status'][$item['status']]?></td>
				<td><?php echo $item['activate']?></td>
				<td><?php echo $item['expire']?></td>
				<td><?php echo $item['contact_name']?></td>
			</tr>
			<?php $i++; }?>
		</table>
		<!-- paging -->
			<div class="myclear martop20">
				<div class="brv-paging-left">
					<table class="tbl-list brv-paging" border="1">
						<tr>
							<td class="brv-paging-name">
								<?php echo $lang['page'].' '. $page.' ['.$totalPage.']'?>
							</td>
							
							<td class="brv-paging-pre-next">
								<img class="brv-img-pre" alt="previous" src="/images/imgpre.gif" onclick="goPage(<?php echo $page > 1 ? $page - 1 : $page;?>)" />
								<img class="brv-img-next" alt="next" src="/images/imgnext.gif" onclick="goPage(<?php echo  $page < $totalPage ? $page + 1 : $page;?>)" />
							</td>
						</tr>
					</table>
				</div>
				<!-- important. fix for ie 6. Don't remove -->
				<!--[if IE 6]><br class="clearboth" /><![endif]-->
			</div>
			<!-- end paging -->
	</div>
</div><br />
<script language="javascript">
function goPage(strVal)
{
	<?php
	echo "var url = '".site_url('user/viewzone/?id='.$zone_id)."';\n";
	?>
	window.location = url + '&page=' + strVal;
}
</script>